using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace FastFoodToNight.Models.Mapping
{
    public class DanhMucSanPhamMap : EntityTypeConfiguration<DanhMucSanPham>
    {
        public DanhMucSanPhamMap()
        {
            // Primary Key
            this.HasKey(t => t.madanhmuc);

            // Properties
            this.Property(t => t.tendanhmuc)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("DanhMucSanPham");
            this.Property(t => t.madanhmuc).HasColumnName("madanhmuc");
            this.Property(t => t.tendanhmuc).HasColumnName("tendanhmuc");
            this.Property(t => t.khoa).HasColumnName("khoa");
        }
    }
}
